//
//  ViewController.swift
//  SwiftFountionDemo
//
//  Created by huangjia on 2017/5/2.
//  Copyright © 2017年 xyhuangjia. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
       
        func test(a:Int) ->(Int) ->Int{
            return{ val in 
                return a * val
            }
        }  
        
        let  t = test(a: 4)
        print(t(2))
        
        
        let square = {(val :Int) ->Int in
            return val * val
        }
        print(square(5))
        
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

